package com.example.demo.ReentrantLock锁;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @description:
 * @projectName:demo
 * @see:ReentrantLock锁
 * @author:袁成龙
 * @createTime:2020/10/7 13:12
 * @version:1.0
 */
public class TestReentrantLock {


    public static void main(String[] args) {

        //所有要实现ReentrantLock的话必须要使用同一个实例
        ReentrantLock lock  = new ReentrantLock();

        TestRunnable runnable = new TestRunnable(lock);
        TestRunnable runnable1 = new TestRunnable(lock);

        runnable.start();
        runnable1.start();
    }

}